<template>
  <div class="activity_choose_coupon">
     <vxe-table
        ref="couponList"
        border
        resizable
        highlight-hover-row
        :auto-resize="true"
        :data="couponList"
        width
        max-height="500"
        :print-config="{}"
        highlight-current-row
        text-algin="center"
        :radio-config="{highlight: true}"
        @radio-change="radioChangeEvent"
      >
        <vxe-table-column type="radio" width="35" />
        <vxe-table-column field="name" min-width="150" title="名称" />
        <vxe-table-column field="nameRemark" min-width="50" title="备注" />
        <vxe-table-column field="worth" width="110" title="面值" />
      </vxe-table>
      <vxe-pager
        :current-page.sync="searchCouponParams.pageNum"
        :page-size.sync="searchCouponParams.pageSize"
        :total="couponTotal"
        :layouts="['PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump', 'FullJump', 'Total']"
        @page-change="getList"
      />
  </div>
</template>
<script>
import { getCouponPageList } from '@/api/discountCoupon'
export default {
  data() {
    return {
      searchCouponParams: {
        status: 0,
        pageNum: 1,
        pageSize: 20
      },
      couponList:[],
      couponTotal:0
    }
  },
  mounted(){
    this.getList()
  },
  methods:{
    // 列表
    getList() {
      getCouponPageList(this.searchCouponParams).then(res => {
        this.couponList = res.records
        this.couponTotal = res.total
      })
    },
    radioChangeEvent(val) {
      this.$emit('radioBox', val.row);
    },
  }
}
</script>
<style lang="scss" scoped>
  // .activity_choose_coupon{}
</style>